package com.megopokir;

import java.awt.*;
import java.awt.event.KeyEvent;

import static java.awt.event.KeyEvent.*;

public class KeyPresser {

    private static Robot robot = null;

    static {
        try {
            robot = new Robot();
        } catch (AWTException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws AWTException {
        sayEda();
    }

    private static void sayYura() throws AWTException {
        robot.delay(5000);
        for(int i = 0; i < 20; i++) {
            robot.delay(500);
            say(VK_Y, VK_U, VK_R, VK_A, VK_ENTER);
        }
    }

    private static void sayEda() {
        robot.delay(3000);
        for(int i = 0; i < 20; i++)
            say(VK_T, VK_L, VK_F, VK_ENTER);
    }

    private static void say(Integer... keyEvents) {
        for(Integer event : keyEvents) {
            robot.keyPress(event);
            robot.keyRelease(event);
        }
    }

}
